package com.sedna.recipenote.common.controller;

import org.apache.log4j.Logger;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.sedna.recipenote.framework.value.UserValue;

@Controller
@RequestMapping(value="home")
public class HomeController {
	private static Logger logger = Logger.getLogger(HomeController.class);

	@RequestMapping(method = RequestMethod.GET)
	public String goHome(Model model) {
		UserValue userValue = (UserValue)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
		model.addAttribute("userValue", userValue);
		return "common/home";
	}
}
